package com.fwj.base.exception;

/**
 * CustomException
 *
 * @author 樊温军
 * @date 2025/3/22 上午11:22
 */
public class CustomException extends RuntimeException {
    private int statusCode;
    private String errorCode;
    private String errorMessage;

    public CustomException(String errorMessage) {
        super(errorMessage);
        this.statusCode = 1;
        this.errorCode = "Custom Exception";
        this.errorMessage = errorMessage;
    }

    public CustomException(String errorMessage, int statusCode, String errorCode) {
        super(errorMessage);
        this.statusCode = statusCode;
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public CustomException(Exception e) {
        super(e.getMessage());
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}